18. Notebook + Quiz: Simulating from the Null

Simulating From the Null Hypothesis

In the previous lesson on confidence intervals, we saw how we could simulate a sampling distribution for a statistic by bootstrapping our sample data. Alternatively, in hypothesis testing, we could simulate a sampling distribution from the null hypothesis using characteristics that would be true if our data were to have come from the null.

In this notebook, you will walk through this process, and answer some quiz questions to solidify your understanding.

Workspace

This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity , so you may be able to download them there.

Workspace Information:

  • Default file path:
  • Workspace type: jupyter
  • Opened files (when workspace is loaded): n/a

QUIZ QUESTION: :

Quiz 1 : Use the first question above to match the null and alternative to the appropriate statements.

ANSWER CHOICES:



Null or Alternative

Statement

The average height for the sample of coffee drinkers is not the same as the average height for the sample for non-coffee drinkers.

The average height for all coffee drinkers is not the same as the average height for all non-coffee drinkers.

The average height for the sample of coffee drinkers is the same as the average height for the sample for non-coffee drinkers.

The average height for all coffee drinkers is the same as the average height for all non-coffee drinkers.

SOLUTION:

Null or Alternative

Statement

The average height for all coffee drinkers is not the same as the average height for all non-coffee drinkers.

The average height for all coffee drinkers is the same as the average height for all non-coffee drinkers.

QUIZ QUESTION: :

Quiz 2 : Use the second question above to match the null and alternative to the appropriate statements.

ANSWER CHOICES:



Null or Alternative

Statement

The average height for all coffee drinkers is the same or less than the average height for all non-coffee drinkers.

The average height for all coffee drinkers is the same or greater than the average height for all non-coffee drinkers.

The average height for all coffee drinkers is greater than the average height for all non-coffee drinkers.

The average height for all coffee drinkers is less than the average height for all non-coffee drinkers.

SOLUTION:

Null or Alternative

Statement

The average height for all coffee drinkers is the same or greater than the average height for all non-coffee drinkers.

The average height for all coffee drinkers is less than the average height for all non-coffee drinkers.

QUIZ QUESTION: :

Quiz 3 : Use the results of your sampling distributions for question 3 above to match the following values to the correct description.

ANSWER CHOICES:



Description

Value

Normal

0.24

The Law of Large Numbers

0.41

Skewed

The Central Limit Theorem

0.47

SOLUTION:

Description

Value

Normal

0.24

0.41

The Central Limit Theorem

0.47

Use your solutions about the sampling distribution, and what difference in means would be likely from the null hypothesis to mark all of the below that are true.

SOLUTION:
  • We can expect the standard deviation of the sampling distribution for differences from the null to be essentially the same as what we observed from the data.
  • If the null hypothesis is true, we would expect the difference in means of coffee drinkers and non-drinkers to be zero.